var path = require('path');

var config = {
  entry: [
    /** 文件更新后 浏览器自动刷新*/
    'webpack/hot/dev-server',
    'webpack-dev-server/client?http://localhost:8080',
    /** 打包的入口文件*/
    path.resolve(__dirname, 'app/main.js')
  ],

  /** 打包的出口文件*/
  output: {
    path: path.resolve(__dirname, 'build'),
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
        query: {
          presets: ['es2015', 'stage-0' ,'react']
        }
      },
      {
        /** 编译sass文件*/
        test: /\.scss$/,
        loader: 'style!css!sass'
      }, {
        /** 图片如果不大于 25KB 的话要自动转成 BASE64 字符串*/
        test: /\.(png|jpg)$/,
        loader: 'url?limit=25000'
      },{
        test: /\.css$/,
        loader: 'style-loader!css-loader!postcss-loader'
      }
    ]
    // noParse: [pathToReact , pathToReacttow]
  }
};

module.exports = config;